/*
 * Copyright (c) JoinQuant Development Team
 * Author: Huayong Kuang <kuanghuayong@joinquant.com>
 */

#include <iostream>
#include <iterator>
#include <vector>
#include <sstream>

using namespace std;

string join(const vector<string>& vec, const char* delim)
{
    ostringstream res;
    copy(vec.begin(), vec.end(), ostream_iterator<string>(res, delim));
    return res.str();
}

int main(void)
{
    vector<string> v_str;
    v_str.push_back("hello");
    v_str.push_back("world");
    v_str.push_back("!");

    string ret = join(v_str, "|");
    cout << ret << endl;

    return 0;
}
